#pragma once
#include <Rz/Object.h>
#include <Rz/Graphics/Render/ISamplerState.h>
#include <Rz/Graphics/Render/Libraries/OpenGL/GLRenderDevice.h>

namespace Rz { namespace Graphics { namespace Render { namespace Libraries { namespace OpenGL {

// TODO: implement _dirty
class GLSamplerState :
	public Object,
	public ISamplerState
{
	public:
		RZ_RTTI(Rz::Graphics::Render::Libraries::OpenGL, GLSamplerState);
		RZ_RTTI_IMPLEMENTS(Object, ISamplerState);
		RZ_RTTI_END;

		GLSamplerState(IRenderDevice* renderDevice);
		virtual ~GLSamplerState();

		virtual void Bind() override;
		virtual void Bind(u32 index);
		virtual void Unbind() override;
		
	private:
		GLint TranslateAddressMode(TextureAddressMode address);
		bool IsDirty() const;

		GLuint _handle;
		bool _isDirty;
};

} } } } }
